/**
 * @Author Yenchingcheng
 * @Date 2023/5/28 23:32
 * @Description
 **/
public class FactoryProducer {

    public static Factory getFactory(String choice) {
        if (choice == null) {
            return null;
        }
        if (choice.equalsIgnoreCase("fruit")) {
            return new FruitFactory();
        } else if (choice.equalsIgnoreCase("method")) {
            return new MethodFactory();
        }
        return null;
    }
}
